import time

from selenium import webdriver
from selenium.webdriver.common.by import By


driver=webdriver.Firefox()
driver.get('C:\Users\15220\Desktop\alert.html')
time.sleep(2)
driver.find_element(By.ID,'button').click()
time.sleep(3)
alert=driver.switch_to.alert
alert.accept()
time.sleep(3)